From 43352b215d30cebbfc4d6e133cf281fce29e7538 Mon Sep 17 00:00:00 2001 From: "rneugeba@wyvis.research.intel-research.net" Date: Fri, 25 Feb 2005 17:27:21 +0000 Subject: [PATCH] bitkeeper revision 1.1238 (421f5ff99YUDAfj5D9rbZseED1YYVA) added performance counters for hypercalls and exceptions Signed-off-by: michael.fetterman@cl.cam.ac.uk --- xen/arch/x86/x86_32/asm-offsets.c | 3 +++ xen/arch/x86/x86_32/entry.S | 10 ++++++++-- xen/common/perfc.c | 2 +- xen/include/xen/perfc_defn.h | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/x86_32/asm-offsets.c b/xen/arch/x86/x86_32/asm-offsets.c index 839893b793..4a609826a1 100644 --- a/xen/arch/x86/x86_32/asm-offsets.c +++ b/xen/arch/x86/x86_32/asm-offsets.c @@ -68,4 +68,7 @@ void __dummy__(void) BLANK(); DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE)); + + OFFSET(PERFC_hypercalls, struct perfcounter_t, hypercalls); + OFFSET(PERFC_exceptions, struct perfcounter_t, exceptions); } diff --git a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S index b47edf86f8..f1fa6df104 100644 --- a/xen/arch/x86/x86_32/entry.S +++ b/xen/arch/x86/x86_32/entry.S @@ -60,7 +60,7 @@ #include #include #include - + #define GET_CURRENT(reg) \ movl $STACK_SIZE-4, reg; \ orl %esp, reg; \ @@ -278,8 +278,11 @@ ENTRY(hypercall) subl $4,%esp SAVE_ALL(b) sti +#ifdef PERF_COUNTERS + lock incl SYMBOL_NAME(perfcounters)+PERFC_hypercalls(,%eax,4) +#endif GET_CURRENT(%ebx) - andl $(NR_hypercalls-1),%eax + andl $(NR_hypercalls-1),%eax call *SYMBOL_NAME(hypercall_table)(,%eax,4) movl %eax,XREGS_eax(%esp) # save the return value @@ -466,6 +469,9 @@ error_code: movw XREGS_entry_vector(%esp),%ax movl %esp,%edx pushl %edx # push the xen_regs pointer +#ifdef PERF_COUNTERS + lock incl SYMBOL_NAME(perfcounters)+PERFC_exceptions(,%eax,4) +#endif GET_CURRENT(%ebx) call *SYMBOL_NAME(exception_table)(,%eax,4) addl $4,%esp diff --git a/xen/common/perfc.c b/xen/common/perfc.c index 4a5c170850..61dd983ea2 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -66,7 +66,7 @@ void perfc_printall(unsigned char key) case TYPE_S_ARRAY: for ( j = sum = 0; j < perfc_info[i].nr_elements; j++ ) sum += atomic_read(&counters[j]); - printk("TOTAL[%10d]\n ", sum); + printk("TOTAL[%10d] ", sum); for ( j = 0; j < perfc_info[i].nr_elements; j++ ) { printk("A%02d[%10d] ", j, atomic_read(&counters[j])); diff --git a/xen/include/xen/perfc_defn.h b/xen/include/xen/perfc_defn.h index 18db383a2c..ff9d4a2243 100644 --- a/xen/include/xen/perfc_defn.h +++ b/xen/include/xen/perfc_defn.h @@ -41,6 +41,8 @@ PERFCOUNTER_CPU( check_all_pagetables, "calls to check_all_pagetables" ) PERFCOUNTER_ARRAY( wpt_updates, "writable pt updates", PERFC_MAX_PT_UPDATES ) PERFCOUNTER_ARRAY( bpt_updates, "batched pt updates", PERFC_MAX_PT_UPDATES ) +PERFCOUNTER_ARRAY( hypercalls, "hypercalls", NR_hypercalls ) +PERFCOUNTER_ARRAY( exceptions, "exceptions", 32 ) /* XXX constant */ #define VMX_PERF_EXIT_REASON_SIZE 37 #define VMX_PERF_VECTOR_SIZE 0x20 -- 2.30.2